package 第二章;
import java.util.Scanner;
//导入Scanner
public class 第二章总结 {
    public static void main(String[] args) {
        Scanner input=new Scanner(System.in);
        //创建Scanner
        int a=input.nextInt();
        //输入一个数，并把值赋值给a
        int b=input.nextInt();
        //输入一个数，并把值赋值给b
        System.out.println(a);
        //显示a的值
        System.out.println(b);
        //算术运算
        //显示b的值
        int x=2;
        //把2赋值给x
        int y=2;
        //把1赋值给y
        int z1,z2,z3,z4;
        z1=x++;
        //先赋值，在计算，2
        z2=++x;
        //先计算，在复制,4
        z4=x+++y--;
        //6
        z3=++x+y--;//7
        System.out.println(z1);
        System.out.println(z2);
        System.out.println(z3);
        System.out.println(z4);
        //%d      整数类型
        //%s      字符串类型
        //%b      布尔类型
        //%f      浮点类型
        //%%      百分比类型
        //%n      换行
        int x1=2,y1=1;
        System.out.printf("%d+%d=%d%n",x1,y1, (x1+y1));
        //x和y的和3
        System.out.printf("%d-%d=%d%n",x1,y1,(x1-y1));
        //x1和y1的差1
        System.out.printf("%d*%d=%d%n",x1,y1,(x1*y1));
        //x1和y1的积2
        System.out.printf("%d/%d=%d%n",x1,y1,(x1/y1));
        //x1和y1的商2
        System.out.println(x1%y1);//x1的y1的余0

        int x2=3 , y2=5;
        boolean z5,z6,z7,z8,z9,z10,z11,z12,z13,z14;
        //布尔型数据
        z5=(x2==y2);
        //x2和y2是否等于
        z6=(x2!=y2);
        //x2和y2是否不等于
        z7=(x2>y2);
        //x2大于y2
        z8=(x2<y2);
        //x2小于y2
        z9=(x2>=y2);
        //x2大于等于y2
        z10=(x2<=y2);
        //x2小于等于y2
        z11=(x2==y2)&(x2!=y2);
        //操作数做与运算
        z12=(x2==y2)|(x2!=y2);
        //操作数做或运算
        z13=(x2>y2)^(x2!=y2);
        //操作数做异或运算
        z14=!(x2==y2)&(x2!=y2);
        //操作数做非
        //关系运算
        System.out.println(z5);
        //结果为false
        System.out.println(z6);
        //结果为true
        System.out.println(z7);
        //结果为false
        System.out.println(z8);
        //结果为true
        System.out.println(z9);
        //结果为false
        System.out.println(z10);
        //逻辑运算
        //结果为true
        System.out.println(z11);
        //结果为false
        System.out.println(z12);
        //结果为true
        System.out.println(z13);
        //结果为true
        System.out.println(z14);
        //结果为true
        //赋值运算
        int x3=3,y3=5;
        x3+=y3;
        //x3=x3+y3
        System.out.println(x3);
        //结果为8
        x3-=y3;
        //x3=x3-y3
        System.out.println(x3);
        //结果为3
        x3*=y3;
        //x3=x3*y3
        System.out.println(x3);
        //结果为15
        x3/=y3;
        //x3=x3/y3
        System.out.println(x3);
        //结果为3
        x3%=y3;
        //x3%y3
        System.out.println(x3);
        //结果为3

    }
}
